﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QYWebSiteBN
{
    public partial class Form_Content_Replace : Form
    {
        private int index = -1;
        public Form_Content_Replace()
        {
            InitializeComponent();
        }

        public Form_Content_Replace(int index,string source,string obj):this()
        {
            this.index = index;
            this.txtSource.Text = source;
            this.txtObject.Text = obj;
        }

        

        private void btnConfirm_Click(object sender, EventArgs e)
        {

            if (txtObject.Text==null)
            {
                MessageBox.Show("目标内容不能为空!");
                txtObject.Focus();
                return;
            }

            Form_Tag ftag = (Form_Tag)this.Owner;
            ftag.updateContentRepace(index, txtSource.Text, txtObject.Text);
            this.Close();


        }

        /// <summary>
        /// 向源内容框追加(*)
        /// </summary>
        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            txtSource.AppendText("(*)");
        }

        private void lbparam_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            txtSource.AppendText("参数[]");
        }

        private void lbparam1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            txtObject.AppendText("参数[1]");
        }

        private void lbparam2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            txtObject.AppendText("参数[2]");
        }

        private void lbparamn_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            txtObject.AppendText("参数[n]");
        }

        private void btnCancal_Click(object sender, EventArgs e)
        {
            this.Close();
        }




 

    }
}
